home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 013 / sd3.arc / SD3.TXT < prev   
Encoding:
Text File  |  1987-06-15  |  21.6 KB  |  499 lines

  1.  
  2.  
  3.  
  4.             Switch Directory 3.0                                          June 15, 1987
  5.  
  6.  
  7.  
  8.  
  9.             Introduction
  10.             ------------
  11.  
  12.                  Switch  Directory  (SD)  is  a  utility that allows easy switching
  13.                  between subdirectories and drives  with a  minimum of  typing.  SD
  14.                  has  been  designed  to  replace  the  DOS  CD command and provide
  15.                  enhancements to the CD  command.    SD  allows  you  to  specify a
  16.                  specific  subdirectory  name,  a combination of subdirectory names
  17.                  and search switches or a complete path specifier.  All features of
  18.                  SD work  across disk  drives.  If you have made a mistake, hitting
  19.                  Ctrl-Brk while SD is searching will  break you  out of  SD and put
  20.                  you back  in the subdirectory you started in.  With version 3.0 SD
  21.                  will also except a 'minimum match' to a subdirectory name (i.e. if
  22.                  you have  only one directory that begins with 'LO' then SD LO will
  23.                  take you there even if the full name is LOTUS).  Given a full path
  24.                  designation, SD  switches to the specified path without searching.
  25.                  An important feature of SD is that it can be enqueued to PCED, the
  26.                  DOS Command  EDitor by Chris Dunford and its public domain counter
  27.                  part CED.  When enqueued SD  will seem  like an  extension of DOS.
  28.                  In this  configuration SD  does NOT have to be present anywhere on
  29.                  your disk drives.   Begining  with  version  3.0,  issuing  a type
  30.                  sd.com at the DOS prompt will report the version number.
  31.  
  32.             Available Commands
  33.             ------------------
  34.  
  35.                  [blank]           - display current path
  36.  
  37.                  \                 - return to root directory
  38.  
  39.                  \[path]           - switch to the specified path
  40.  
  41.                  /[subdirectory]   - search   below   the   current  directory  for
  42.                                      'subdirectory'
  43.  
  44.                  [c                - enqueue SD to CED ('c' must be lowercase)
  45.  
  46.                  [p                - enqueue SD to PCED ('p' must be lowercase)
  47.  
  48.                  [p+               - enqueues SD to PCED  but do  not provide help.
  49.                                      (Using  this  combination  saves  almost 1K of
  50.                                      memory) (use [c+ for CED)
  51.  
  52.                  ?                 - display  help  information  (if  not installed
  53.                                      with the [+ command)
  54.  
  55.                  ..                - back up one directory
  56.  
  57.                  Combinations  of  \  and  /  may  be used to increase the speed of
  58.                  searching while still reducing the required typing.
  59.  
  60.                  All commands work accross  drives with  the exception  of the show
  61.                  path command.  SD is NOT case sensitive (except for SD [c or [p)
  62.  
  63.                                                   1
  64.  
  65.  
  66.             Switch Directory 3.0                                          June 15, 1987
  67.  
  68.  
  69.             Acknowledgement
  70.             ---------------
  71.  
  72.                  I would like to thank Jack Kilday, sysop of Northern Lights BBS in
  73.                  Maine for his efforts Beta testing SD and  his ideas  for improve-
  74.                  ments.
  75.  
  76.  
  77.             Examples
  78.             --------
  79.  
  80.               Suppose your hard disk directory looked something like this:
  81.  
  82.                       [Root]------DOS---|---DISKUTIL
  83.                                         |
  84.                                         |---TURBO--|--SOURCE
  85.                                         |          |
  86.                                         |          |--TOOLS
  87.                                         |
  88.                                         |---WORDPERF
  89.  
  90.               Then, if we wanted to switch to this drive we could use:
  91.  
  92.                  SD d:             - would  change the  active drive  to d: and put
  93.                                      you in the  default  directory  which  we will
  94.                                      assume  is   the  [Root]  directory  (this  is
  95.                                      similar to typing d: at the DOS prompt)
  96.  
  97.                  Now that we are in the [Root] directory, lets switch  to the TURBO
  98.                  subdirectory.
  99.  
  100.                  SD /TURBO         -  would  search  [Root]  for subdirectories and
  101.                                      would find DOS.  SD would then search  the DOS
  102.                                      subdirectory for  the TURBO subdirectory.  The
  103.                                      actual search pattern would be to  search DOS,
  104.                                      find  DISKUTIL,  search  it, find no subdirec-
  105.                                      tories so back up  to DOS.   Then recommencing
  106.                                      the search  in DOS,  SD would  find TURBO next
  107.                                      and change to that subdirectory.
  108.  
  109.                  You should  note that  in our  example, since  the TU  of TURBO is
  110.                  unique we could have used SD /TU with the same results.
  111.  
  112.                  Now, to go back to DOS we have two options, the first is
  113.  
  114.                  SD \DOS           -  In  this  case  SD  would  recognize the path
  115.                                      specifier and search the command line for the
  116.                                      complete path specification.  Upon finding the
  117.                                      end  of  the  line  SD would call DOS with the
  118.                                      \DOS pathname, which in our case  is valid, so
  119.                                      we  would  be  taken  to  DOS.  In the case of
  120.                                      pathnames the complete path MUST be specified.
  121.                                      Please  note  that  this is different from the
  122.                                      last example with the minimum matching.
  123.  
  124.  
  125.                                                   2
  126.  
  127.  
  128.             Switch Directory 3.0                                          June 15, 1987
  129.  
  130.  
  131.                  Our second option for returning to the DOS subdirectory is to use
  132.  
  133.                  SD ..             - This command 'backs up' one directory.  In our
  134.                                      case that happens to be the DOS directory.
  135.  
  136.                  We could use this command again to back up to the [Root] directory
  137.                  or we could use
  138.  
  139.                  SD \              - Which switches us to the [Root] directory.
  140.  
  141.                  If we wanted to do more complex searching  to search  a large hard
  142.                  disk with  many levels  of subdirectories  we might want to type a
  143.                  'short hand' version of the complete path to facilitate the search
  144.                  and increase  speed.  To switch to the TOOLS subdirectory we could
  145.                  use
  146.  
  147.                  SD /TURBO\TOOLS   - This would search  below the  [Root] directory
  148.                                      for  the  TURBO  directory.   Upon finding the
  149.                                      TURBO directory, SD would execute a  switch to
  150.                                      the  current  path  plus  the \TOOLS. (i.e. SD
  151.                                      calls DOS for the  current  path  then appends
  152.                                      the \TOOLS  to that path.  If this combination
  153.                                      is valid then the change occurs.)
  154.  
  155.                  As a reminder, remember that SD /TU\TOOLS would also be valid.
  156.  
  157.                  Now we could also get to the tools directory by simply using
  158.  
  159.                  SD TOOLS          - With this syntax SD would search  the current
  160.                                      directory for  a TOOLS  subdirectory and then,
  161.                                      if it was not  found, would  search the entire
  162.                                      disk for a TOOLS directory.  With this type of
  163.                                      command SD  provides the  most convenience but
  164.                                      the price  is speed  of switching directories.
  165.                                      On a large hard disk with  30 to  40 subdirec-
  166.                                      tories the  search can  take up  to 5 seconds.
  167.                                      However, as our previous examples show, we can
  168.                                      add some more specifications to the search and
  169.                                      it will speed up  considerably. (Again,  SD TO
  170.                                      would also be correct)
  171.  
  172.                  Some of the other available options are
  173.  
  174.                  SD                - SD  without  any  parameters  will  report the
  175.                                      current path.
  176.  
  177.                  SD [c             - This  will  enqueue  SD  to  CED,  the Command
  178.                                      EDitor by  Chris Dunford,  virtually making SD
  179.                                      an extension of DOS.  In  such a configuration
  180.                                      the SD.COM file does not have to be present on
  181.                                      any of your disk drives.
  182.  
  183.  
  184.  
  185.  
  186.  
  187.                                                   3
  188.  
  189.  
  190.             Switch Directory 3.0                                          June 15, 1987
  191.  
  192.  
  193.  
  194.                  SD [c+            - This is the same as the last command  with the
  195.                                      added  effect  of  not  providing online help.
  196.                                      This can  be  used  to  reduce  the  amount of
  197.                                      memory SD  takes when  it terminates and stays
  198.                                      resident.
  199.  
  200.                  SD ?              - Provides online help (unless the SD [+ command
  201.                                      has been used)
  202.  
  203.  
  204.             Caveats and Other Things
  205.             ------------------------
  206.  
  207.                  Caveats first.   If  you have  duplicate subdirectory names and do
  208.                  not specify a path but merely let SD search, SD  will drop  you in
  209.                  the first  matching directory  it finds.   SD will only search the
  210.                  drive that is specified.  Currently, SD is limited to subdirectory
  211.                  trees less  than ten  deep.   This limit is arbitrary and could be
  212.                  changed by reassembling SD.
  213.  
  214.                  The source was initially derived from  Vern Buerg's  sorted direc-
  215.                  tory program,  LDIR and WHISK by Charles Wooster.  To this initial
  216.                  base I have added many modifications.  The 'FindCED' procedure was
  217.                  provided by  Christoper J.  Dunford as  part of  the PCED package.
  218.                  Information on PCED can be obtained from:
  219.  
  220.                                 The Cove Software Group
  221.                                 Post Office Box 1072
  222.                                 Columbia, Maryland  21044
  223.                                 (301) 992-9371
  224.  
  225.                  The code is written for the  A86 assembler.   This  shouldn't be a
  226.                  problem for anyone who is using MASM.
  227.  
  228.                  If you  have any  comments, suggestions  or bug  reports drop me a
  229.                  line on Bob Blacher's Computer Connection  in DC  or Jack Kilday's
  230.                  Northern Lights in Maine.
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.                                                   4
  250.  
  251.  
  252.             Switch Directory 3.0                                          June 15, 1987
  253.  
  254.  
  255.  
  256.             Error Messages
  257.             --------------
  258.  
  259.                  The possible error messages are as follows:
  260.  
  261.  
  262.                       ERROR - Installed without help
  263.  
  264.                                 This message  is displayed  if SD is installed with
  265.                                 the [c+ command and SD ? is later  typed to request
  266.                                 help.
  267.  
  268.  
  269.                       Illegal drive specifier - must be A to z
  270.  
  271.                                 If  SD  finds  a  ':' character on the command line
  272.                                 that is not preceded by a letter it will issue this
  273.                                 message.
  274.  
  275.                       Maximum of 64 characters on command line
  276.  
  277.                                 The command  line is  limited to 64 characters.  If
  278.                                 SD counts more than this it will issue this error.
  279.  
  280.                       Illegal character on command line
  281.  
  282.                                 If a period that is not part of the SD  .. command,
  283.                                 or the  enqueue character ([) is found in any place
  284.                                 but the first on  the command  line, SD  will issue
  285.                                 the illegal character error message
  286.  
  287.                       Currently in root directory
  288.  
  289.                                 If  the  SD  ..  command is entered from the [Root]
  290.                                 directory the SD issues this message
  291.  
  292.                       Command line contains an invalid path
  293.  
  294.                                 If any invalid  path  command  is  entered  SD will
  295.                                 issue this  message.  An invalid path can be caused
  296.                                 by several  things.   It can  be due  to an illegal
  297.                                 character (such  as < or >) in the pathname, by a /
  298.                                 command followed by a \ command, where the \path is
  299.                                 not an  immediate subdirectory of the directory the
  300.                                 / command found or simply by  entering a  path that
  301.                                 does not exist.
  302.  
  303.                       Subdirectory Not Found
  304.  
  305.                                 If SD  cannot find the desired subdirectory it will
  306.                                 issue this message.  The subdirectory may not exist
  307.                                 on the drive at all or it may not be a subdirectory
  308.                                 of  the  current  directory  (if  a  /  command was
  309.                                 issued)
  310.  
  311.                                                   5
  312.  
  313.  
  314.             Switch Directory 3.0                                          June 15, 1987
  315.  
  316.  
  317.  
  318.             Errorlevel and Batch Files
  319.             --------------------------
  320.  
  321.                  SD can  be used from inside batch files.  To facilitate its use in
  322.                  this environment SD returns error codes that can be read  with the
  323.                  Errorlevel command in batch files.  Error levels are only returned
  324.                  when SD is NOT enqueued to CED or PCED.   The error  levels are as
  325.                  follows:
  326.  
  327.                       0 - No errors detected
  328.                       1 - Illegal drive specifier
  329.                       2 - Maximum of 64 characters on command line
  330.                       3 - Illegal character on command line
  331.                       4 - Currently in root directory
  332.                       5 - Command line contains an invalid path
  333.                       6 - Subdirectory Not Found
  334.                       7 - Error attempting to enqueue to PCED
  335.                       8 - Error attempting to enqueue to CED
  336.  
  337.  
  338.             Changing the Internal Name of SD
  339.             --------------------------------
  340.  
  341.                  When SD  is enqueued  to PCED, (or CED) PCED must know the command
  342.                  to trap.  SD informs PCED  that whenever  SD is  typed at  the DOS
  343.                  prompt  to  intercept  the  command  line  and pass it to SD.  The
  344.                  string defining the name PCED is to look for begins at offset 0D41
  345.                  in the  SD.COM file.  The string currently contains 'sd' (PCED and
  346.                  CED are not case sensitive) followed  by a  carriage return  and 6
  347.                  null bytes (zeros).  This string can be edited to contain any name
  348.                  up to 8 characters.  The string MUST  be terminated  by a carriage
  349.                  return (hex  0D).   Upon enqueueing  to PCED,  PCED will recognize
  350.                  this new name you have created  and will  no longer  recognize SD.
  351.                  (However, if  you change  this internal name and do not change the
  352.                  name of the SD.COM file, typing SD at the DOS prompt will work but
  353.                  you will  not be  accessing the  memory resident  code you will be
  354.                  accessing the program on disk.)
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.                                                   6
  374.  
  375.  
  376.             Switch Directory 3.0                                          June 15, 1987
  377.  
  378.  
  379.  
  380.             License
  381.             -------
  382.  
  383.                  SD 3.0, Copyright (c) Stephen M. Falatko 1987.
  384.                  ALL RIGHTS RESERVED. (This does not apply to the PrintS, GetDir or
  385.                  FindCED procedures)
  386.  
  387.                  SD is  free, but  it is  a copyrighted work and may be distributed
  388.                  only pursuant to this license.
  389.  
  390.                  Permission is hereby granted  to reproduce  and disseminate  SD so
  391.                  long as:
  392.  
  393.                             1)  No  remuneration  of  any kind is received in ex-
  394.                                 change; and
  395.  
  396.                             2)  Distribution is  WITHOUT  ANY  modification  to the
  397.                                 contents  of  SD.COM  and all accompanying documen-
  398.                                 tation and/or support files,  including the copyri-
  399.                                 ght notice and this license.
  400.  
  401.                  No copy  of SD may be distributed without including a copy of this
  402.                  license.
  403.  
  404.                  Any other use is prohibited without express, written permission in
  405.                  advance.
  406.  
  407.                                                   Stephen M. Falatko
  408.                                                   311 Wilkes Street
  409.                                                   Alexandria, Virginia 22314
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.                                                   7
  436.  
  437.  
  438.             Switch Directory 3.0                                          June 15, 1987
  439.  
  440.  
  441.  
  442.             Update Notes
  443.             ------------
  444.  
  445.                  Version 1   - 3/12/87
  446.  
  447.                  Version 1.1 - 3/18/87    Bug fix.   An  error in  the routine that
  448.                                           creates  a  full  path  name  for  use in
  449.                                           actually  setting   path  would  preclude
  450.                                           switching to directories whose  depth was
  451.                                           greater than 2 deep.
  452.  
  453.                  Version 2.0 - 5/15/87    Changed the  path search  routine.  Added
  454.                                           new features, the  /  and  \  switches to
  455.                                           search  one  path  deep  and  search only
  456.                                           subdirectories of  the  current directory
  457.                                           respectively.   This provides  a means to
  458.                                           refine  the  searching  and  provide more
  459.                                           speed.   You can  now search other drives
  460.                                           by  specifying  a  drive  on  the command
  461.                                           line.    Added  break out feature so that
  462.                                           hitting Ctrl-Brk  will place  you in your
  463.                                           original directory.
  464.  
  465.                  Version 2.1 - 5/19/87    Jack Kilday,  sysop of Northern Lights in
  466.                                           Maine, suggested that  the  capability to
  467.                                           designate a specific path be added to SD.
  468.                                           This has been  added.    SD  recognizes a
  469.                                           full path  on the command line (by seeing
  470.                                           two or  more '\'  characters) and instead
  471.                                           of  searching  the  entire  disk  for the
  472.                                           subdirectory  explicitly  changes  to the
  473.                                           desired path.
  474.  
  475.                  Version 2.2 - 5/21/87    Bug fix.  Capital drive specifiers caused
  476.                                           and error in the drive switch routine.
  477.  
  478.                  Version 3.0 - 6/15/87    Added   PCED/CED   enqueue   option,  the
  479.                                           ability to do multiple level searches and
  480.                                           the ability to do minimum match searches.
  481.                                           Improved  the  error reporting to reflect
  482.                                           the  new  capabilities.      Changed  the
  483.                                           handling  of  a  single  '\' character as
  484.                                           well as the handling  of  a  change drive
  485.                                           command.     Added  the  path  report  if
  486.                                           command line blank.  'type sd.com  at the
  487.                                           DOS   prompt   now  reports  the  version
  488.                                           number.  Again, many  of the improvements
  489.                                           were suggested by Jack.
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.                                                   8
  498.  
  499.